package com.reebake.ideal.desensitize.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.reebake.ideal.desensitize.enums.DesensitizeType;
import com.reebake.ideal.desensitize.serializer.DesensitizeSerializer;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 脱敏注解
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = DesensitizeSerializer.class)
public @interface JsonDesensitize {
    String value() default "";
    /** 脱敏方式，默认：AUTO 自动 */
    DesensitizeType type() default DesensitizeType.AUTO;
}
